﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ERP.ProductionManage.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;

namespace ERP.ProductionManage
{
    /// <summary>
    /// 客户订单服务接口
    /// </summary>
    public interface ICustomerOrderService : IApplicationService
    {
        /// <summary>
        /// 获取客户订单分页列表
        /// </summary>
        Task<PagedResultDto<CustomerOrderDto>> GetListAsync(GetCustomerOrderInputDto input);

        /// <summary>
        /// 获取客户订单详情
        /// </summary>
        Task<CustomerOrderDto> GetAsync(int id);

        /// <summary>
        /// 创建客户订单
        /// </summary>
        Task<CustomerOrderDto> CreateAsync(CreateCustomerOrderDto input);

        /// <summary>
        /// 更新客户订单
        /// </summary>
        Task<CustomerOrderDto> UpdateAsync(int id, UpdateCustomerOrderDto input);

        /// <summary>
        /// 删除客户订单
        /// </summary>
        Task DeleteAsync(int id);

        /// <summary>
        /// 生成订单编码
        /// </summary>
        Task<string> GenerateOrderCodeAsync();

        /// <summary>
        /// 获取可选择的物料列表（只包含物料，不包含产品）
        /// </summary>
        Task<List<MaterialSelectDto>> GetMaterialsForSelectAsync();

        /// <summary>
        /// 添加订单详情
        /// </summary>
        Task<CustomerOrderDetailDto> CreateOrderDetailAsync(CreateCustomerOrderDetailDto input);

        /// <summary>
        /// 更新订单详情
        /// </summary>
        Task<CustomerOrderDetailDto> UpdateOrderDetailAsync(int detailId, UpdateCustomerOrderDetailDto input);

        /// <summary>
        /// 删除订单详情
        /// </summary>
        Task DeleteOrderDetailAsync(int detailId);

        /// <summary>
        /// 获取订单详情列表
        /// </summary>
        Task<List<CustomerOrderDetailDto>> GetOrderDetailsAsync(int customerOrderId);

        /// <summary>
        /// 生成生产工单
        /// </summary>
        Task GenerateProductionOrderAsync(int customerOrderId);

        /// <summary>
        /// 导出客户订单
        /// </summary>
        Task<byte[]> ExportAsync(GetCustomerOrderInputDto input);

        /// <summary>
        /// 获取产品选择列表
        /// </summary>
        Task<PagedResultDto<ProductSelectDto>> GetProductsForSelectAsync(GetProductSelectInputDto input);

        /// <summary>
        /// 获取客户选择列表
        /// </summary>
        Task<PagedResultDto<CustomerSelectDto>> GetCustomersForSelectAsync(GetCustomerSelectInputDto input);
    }
}
